<template>
  <div class="wrapper">
    <slot v-if="needShow"></slot>
  </div>
</template>
<script setup>
import { ref, computed } from 'vue'
import { userInfoStore } from '@/pinia/userInfo'
import hasPermission from '@/utils/hasPermission'

const userInfo = userInfoStore()

const props = defineProps({needAuth: {type: Array, default: []}})

const needShow = ref(false)

needShow.value = computed(() => {
  return hasPermission(userInfo.userAuth, props.needAuth)
})  

</script>